package com.hzyl.famousreader.view.adapter;

import android.support.annotation.Nullable;
import android.util.TypedValue;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hzyl.famousreader.R;
import com.hzyl.famousreader.repository.persistence.entity.Book;

import java.util.List;

public class ShopNestedAdapter extends BaseQuickAdapter<Book, BaseViewHolder> {

  public ShopNestedAdapter(@Nullable List<Book> data) {
    super(R.layout.item_shop_simple, data);
  }

  @Override
  protected void convert(BaseViewHolder helper, Book item) {
    helper.setText(R.id.shop_tv_simple_name, item.getName());
    TextView view2 = helper.getView(R.id.shop_tv_simple_name);
    view2.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);

    Glide.with(mContext).load(item.getCover()).into((ImageView) helper.getView(R.id.shop_iv_simple_cover));
  }
}
